package com.myspring.controller;

import com.myspring.entity.User;
import com.myspring.service.MyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
//登录界面  拿到登录界面的信息做判断
@Controller
@RequestMapping(value = {"/mycontroller2"})
public class MyController2 {
    @Autowired
    private MyService myService;

    @RequestMapping(value = "/mymethod2/{username}/{password}")
    public ResponseEntity<User> mymethod(@PathVariable(value = "username") String username, @PathVariable(value = "password") String password) throws  Exception{
        return new ResponseEntity<User>(this.myService.checkUser(username,password), HttpStatus.OK);
    }
}
